Slack Integration

A Slack integration with Cloudhouse Guardian (Guardian) allows you to trigger Slack messages to be sent after certain events take place. For example, in the event of a failed scan, you can configure this as an Action that automatically sends a Slack message every time a scan fails in your Guardian instance. This topic describes the steps you need to complete to setup a Slack integration to Guardian.

Note: This topic focuses on setting up the Slack integration. If you've already set up the integration and want to configure Slack actions, see Action: Send a Message to Slack.

Dependencies

To add a Slack integration, you need the following:

  • A Slack account.

  • A webhook URL from Slack is required.

Add a Slack Integration

Integrating Slack withGuardianestablishes a seamless connection to trigger Slack messages to be sent after certain events take place.

To add a Slack integration to Guardian, complete the following:

  1. In the Guardian web application, navigate to the Integrations tab (Control > Integrations) and click Add Integration. The Add Integration page is displayed.

  2. Select Slack from the list of available integrations. Here, you are required to complete the following options:

    Option

    Description

    Webhook URL field

    The unique URL of the existing Slack channel you want messages to be posted. For example, 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'.

    Channel field

    The name of the Slack channel that messages will be posted to. For example, '#general' or '#qa-team'.

    Username field

    A unique name for the user that the message will be posted under. For example, 'Guardian'. This name is how you will identify the sender of the message among all others senders.

    The profile picture for integration user radio buttons

    Slack messages sent by Guardian have an icon in place of a Slack user's profile picture.

    Select one of the following radio buttons to define how you want to set the profile picture:

    • URL – Option to set the profile picture via a URL. If selected, the Icon URL field is displayed.

    • Emoji – Option to set the profile picture via an emoji code. If selected, the Icon Emoji field is displayed.

    For more information on each icon type, see their respective descriptions below.

    Icon URL field

    The URL of the icon you want to use. The URL must lead to a .png file.

    Icon Emoji field The emoji code for the icon you want to use. Emoji codes are strings of text enclosed in colons that Slack interprets as emojis. For example, entering :red_circle: here results in as the icon in the above example. You can find codes for each emoji in your Slack emoji menu.
  3. Once you have set the correct values for each of the options displayed, click Done to create the Slack integration.

If successful, a confirmation message is displayed and the Slack integration is added to the Integrations tab of your Guardian instance. You'll also receive a test message by a bot in the Slack channel you provided while adding the Slack integration. If unsuccessful, an error message is displayed. Use the information displayed in the error message(s) to troubleshoot the values in your Slack Integration options.

Troubleshooting

If you are experiencing issues with your integration, try the following:

  • Verify that the values supplied for the integration are correct.

  • To confirm the status of the integration sync, check the integration sync event in the Events tab (Control > Events) of your Guardian instance. For more information, see Events.